//引入ajax
import { ajax } from "../../public/promiseAjax.js";
// 引入公共js
import * as obj from "../public.js";
const o = obj.default;
// 创建点击事件
function codeF(tel) {
  // ajax获取后端数据
  const code = random()
  console.log(code)
  ajax({
    url: 'http://localhost:3000/usCodeR',
    method: 'post',
    data: {
      tel,
      code:code
    }
  }).then((res) => {
    console.log(res)
  })
}
function random(n) {
  return (Math.random() + "").slice(2, 6);
}
export { codeF }